package org.apache.sad.core.framework.jaxrpc;

/**
 * Maintains endpoint information, including endpoint, user name and password. 
 */
public class Endpoint {
	private String endpoint;
	private String username;
	private String password;
	
	public Endpoint() {
	}
	
	public Endpoint(String endpoint) {
		this.endpoint = endpoint;
	}
	
	public Endpoint(String endpoint, String username, String password) {
		this.endpoint = endpoint;
		this.username = username;
		this.password = password;
	}
	
	public String getEndpoint() {
		return endpoint;
	}
	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public Endpoint copy() {
		return new Endpoint(this.endpoint, this.username, this.password);
	}

	@Override
	public String toString() {
		return "[endpoint=" + endpoint 
					+ (username == null ? "" : ", username=" + username) 
					+ (password == null ? "" : ", password=********")
					+ "]";
	}
}